bgoonz

Snippets 732

original template

original template
<!DOCTYPE HTML>
<!-- saved from url=(0016)http://localhost -->
<!-- This file was generated by [APP NAME] [APP VER] at [GEN DATE] [GEN TIME]. See [APP LINK] for more information -->
<html>
<head>

	<meta http-equiv="content-type" content="text/html; charset=utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=10,IE=9,IE=8">

	<title>[TITLE]</title>
	
	<style type="text/css">

		html, body {
			height:100%;
			margin: 0;
			padding: 0;
		}

		html > body {
			font-size: 16px; 
			font-size: 68

run


{
 "cells": [
  {
   "attachments": {
    "image.png": {
     "image/png": "iVBORw0KGgoAAAANSUhEUgAAAlgAAAIjCAYAAADfg2XeAAAgAElEQVR4AeydB5hVxfnG35k5926h994RpIkI2Bs27LHXWGKLsUST2PM3ajTGXmJJLIktxhp77wUVFUFQRAQE6b3D7t57Zub/vMO5y2VZysKyQfab59m99547Z8rvnHvmPd/3zRxAkhAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASEgBISAEBACQkAICAEhIASEgBAQAkJACAgBISAEhIAQEAJCQAgIASE

lock react-skills

react-skills
Linkedin React.Js Assessment Answers
====================================

#### Q1. If you want to import just the Component from the React library, what syntax do you use?

-   [ ] `import React.Component from 'react'`
-   [ ] `import [ Component ] from 'react'`
-   [ ] `import Component from 'react'`
-   [x] `import { Component } from 'react'`

#### Q2. If a function component should always render the same way given the same props, what is a simple performance optimization available for it?

-

lock linkedinskillz

linkedinskillz
```

Linkedin Front-End Development Assessment Answers
Front-end Development
Q1. Which image matches the flex layout defined in this style rule?
.container {
display: flex;
}

.container div:last-child {
margin-left: auto;
}
•
•
•
•
Q2. Variables declared with the let keyword have what type of scope?
• function scope
• block scope
• inline scope
• global scope
Q3. Why would you surround a piece of text with <h1></h1> tags?
• to indicate that this text is the main heading on the page
• to make th

bash bible

bash bible
# Common Bash Use Cases

# Table of Contents

<!-- vim-markdown-toc GFM -->

- [Common Bash Use Cases](#common-bash-use-cases)
- [Table of Contents](#table-of-contents)
- [STRINGS](#strings)
  - [Trim leading and trailing white-space from string](#trim-leading-and-trailing-white-space-from-string)
  - [Trim all white-space from string and truncate spaces](#trim-all-white-space-from-string-and-truncate-spaces)
  - [Use regex on a string](#use-regex-on-a-string)
  - [Split a string on a delimiter]

write console log output to txt file

write console log output to txt file
let fs = require( 'fs' );
let util = require( 'util' );
let log_file = fs.createWriteStream( __dirname + 'consoleOutput.txt', {
  flags: 'w'
} );
let log_stdout = process.stdout;

console.log = function ( d ) { //
  log_file.write( util.format( d ) + '\n' );
  log_stdout.write( util.format( d ) + '\n' );
};


explinations

explinations
/**
 * An asynchronously iterable queue class. Add values with enqueue()
 * and remove them with dequeue(). dequeue() returns a Promise, which
 * means that values can be dequeued before they are enqueued. The
 * class implements [Symbol.asyncIterator] and next() so that it can
 * be used with the for/await loop (which will not terminate until
 * the close() method is called.)
 */
class AsyncQueue {
  constructor() {
    // Values that have been queued but not dequeued yet are stored here
    th

Glob.js

class Glob {
  constructor(glob) {
    this.glob = glob;

    // We implement glob matching using RegExp internally.
    // ? matches any one character except /, and * matches zero or more
    // of those characters. We use capturing groups around each.
    let regexpText = glob.replace("?", "([^/])").replace("*", "([^/]*)");

    // We use the u flag to get Unicode-aware matching.
    // Globs are intended to match entire strings, so we use the ^ and $
    // anchors and do not implement search

javascript readings

javascript readings

**JavaScript**  

- [Mozilla Docs](https://developer.mozilla.org/en/JavaScript/Reference) - only real documentation for JS  
    - [String](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String)  
    - [Number](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number)  
    - [Array](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array)  
    - [Object](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object)  

links table

links table


# _Absolutely Everything You Could Need To Know About How JavaScript_ TOC & Condensed Links




 **** | **** | **** | **** | **** 
------|------|------|------|------
  1    |   2   |  3    |   4   |    5  
 | [**__leonardomso/33-js-concepts__**\*This repository was created with the intention of helping developers master their concepts in JavaScript. It is not a...\*github.com](https://github.com/leonardomso/33-js-concepts#20-pure-functions-side-effects-and-state-mutation "https://github.com/le

all the links

all the links
[**leonardomso/33-js-concepts**\
*This repository was created with the intention of helping developers master their concepts in JavaScript. It is not a...*github.com](https://github.com/leonardomso/33-js-concepts#20-pure-functions-side-effects-and-state-mutation "https://github.com/leonardomso/33-js-concepts#20-pure-functions-side-effects-and-state-mutation")[](https://github.com/leonardomso/33-js-concepts#20-pure-functions-side-effects-and-state-mutation)

[**Call stack - MDN Web Docs Glossary:

untested copy to clipboard

untested copy to clipboard
const copyToClipboard = (target) => {
  var currentFocus = document.activeElement;
  target.select();
  target.setSelectionRange(0, target.value.length);

  // copy the selection
  var succeed;
  try {
    succeed = document.execCommand("copy");
    console.log(succeed);
  } catch (e) {
    succeed = false;
    console.log(e);
  }
  // restore original focus
  if (currentFocus && typeof currentFocus.focus === "function") {
    currentFocus.focus();
  }

  return succeed;
};

How to download your Udemy course videos using youtube-dl

How to download your Udemy course videos using youtube-dl
# How to download your Udemy course videos using youtube-dl
  > $ youtube-dl --list-extractors | grep udemy
  
 ## Steps
 1.  Get link to the course to download. e.g. https://www.udemy.com/course-name/
 2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
 3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {pat

hash

hash
class Dict:
    def __init__(self, capacity=8):
        self.storage = [None] * capacity        
        self.capacity = capacity
        self.item_count = 0def hash(self, string):
        bytes = string.encode()
        sum = 0
        for byte in bytes:
            sum += byte
        return sum % self.capacity
​
    # def djb2(self, key):
    #     """
    #     DJB2 hash, 32-bit
    #     Implement this, and/or FNV-1.
    #     """
    #     str_key = str(key).encode()#     has

lin-search.js

​
# # Is an item in our array? return true or false
def linear_search(arr, target):
    for i in range(len(arr)):
        if arr[i] == target:
            return True
​
    return False
​
​
def recursive_search(arr, target):
    if len(arr) == 0:
        return False
​
    if arr[0] == target:
        return True
    
    return recursive_search(arr[1:], target)
​
​
def binary_search(array, target):
    min = 0
    max = len(array) - 1while min <= max:
        # find middle, and check
   

path-utils

const join = require("join-path");
const _ = require("lodash");

const INDEX_FILE = "index.html";

const pathutils = {
  asDirectoryIndex: (pathname) => {
    return pathutils.isDirectoryIndex(pathname)
      ? pathname
      : join(pathname, INDEX_FILE);
  },

  isDirectoryIndex: (pathname) => {
    return _.endsWith(pathname, "/" + INDEX_FILE);
  },

  hasTrailingSlash: (pathname) => {
    return _.endsWith(pathname, "/");
  },

  addTrailingSlash: (pathname) => {
    return pathutils.hasTrail